package 二叉树题目.二叉树的最大深度;

public class Solution {
    public int maxDepth(TreeNode root) {
        // write code here
        if (root == null) {
            return 0;
        }
        int leftH = maxDepth(root.left);
        int leftR = maxDepth(root.right);
        return leftH > leftR ? leftH + 1 : leftR + 1;
    }
}
